Link to this headingBuilding from Source

Source

Dependencies:

sudo apt-get install openjdk-8-jdk android-tools-adb bc bison build-essential curl flex g++-multilib gcc-multilib gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev

Make Android:

#Make Dirs mkdir -p android/pie wget 'https://storage.googleapis.com/git-repo-downloads/repo' -P ~/android chmod +x android/repo cd android/pie #Repo Init and Sync repo init -u https://android.googlesource.com/platform/manifest -b android-9.0.0_r52 --depth=1 repo init -u https://android.googlesource.com/platform/manifest -b android-8.1.0_r9 --depth=1 repo sync #Setup ENV varables export USE_CCACHE=1 unset CDPATH prebuilts/misc/linux-x86/ccache/ccache -M 15G export ANDROID_JACK_VM_ARGS="-Xmx8g -Dfile.encoding=UTF-8 -XX:+TieredCompilation" source build/envsetup.sh lunch aosp_arm-eng #Run MAKE #make -j6

Make a subdirectory:

cd system/security/keystore/ mma

Boot Android on a device:

fastboot boot zImage-dtb initrd.img --base 0 --kernel-offset 0x8000 --ramdisk-offset 0x2900000 --tags-offset 0x2700000 -c "console=ttyHSL0,115200,n8 androidboot.hardware=hammerhead user_debug=31 maxcpus=2 msm_watchdog_v2.enable=1"